Re: [SQL] Howto convert floats to text? - Mailing list pgsql-sql

From Herouth Maoz
Subject Re: [SQL] Howto convert floats to text?
Date
Msg-id l03130305b38017f776fa@[147.233.159.109]
Whole thread Raw
In response to Re: [SQL] Howto convert floats to text?  (Martin Leja <martin@unix-ag.org>)
List pgsql-sql
At 20:22 +0300 on 04/06/1999, Martin Leja wrote:


>
> Thanks for the tip, but if i try the above, i get:
> ERROR:  Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'.
> Recognized languages are sql, C, internal and the created procedural
> languages.
>
> what is pl/pgsql? I using postgres 6.3.2 (slink/stable debian package), do
> i hve to upgrade to a higer version, or is this plpgsql thing to be
> installed separately?

pl/pgsql is new in 6.4. If you are working with 6.3.2, you may define a
function in SQL as follows:

testing=> CREATE FUNCTION text( float8 ) returns text
testing-> AS 'select textin( float8out( $1 ) )'
testing-> LANGUAGE 'sql';

Test this:

testing=> select text( 18.4 ) || ' is the number';
?column?
------------------
18.4 is the number
(1 row)

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma




pgsql-sql by date:

Previous
From: Herouth Maoz
Date:
Subject: Re: [SQL] OUTER JOINs in PostgreSQL
Next
From: Herouth Maoz
Date:
Subject: Re: [SQL] Getting primary key from insert statement